package com.douqu.game.battle.entity.tmp;

import com.douqu.game.battle.controller.sprite.PlayerController;
import com.douqu.game.core.entity.Player;
import com.douqu.game.core.protobuf.SGCommonProto;
import com.douqu.game.core.util.CoreUtils;


/**
 * Created by bean on 2017/7/25.
 */
public class PlayerBattleTmp extends SpriteBattleTmp {





//    @Override
//    public BattleAObject createSoldier(Soldier soldier, Card card, Position pos)
//    {
//        BattleAObject battleSoldierAObject = new BattleSoldierAObject(spriteController, soldier, battleController.getSoldierUniqueId(), card);
//        battleSoldierAObject.setTeamNo(teamNo);
//        if(pos == null)
//            battleSoldierAObject.setPosition(battleController.getMiddlePos(teamNo));
//        else
//            battleSoldierAObject.setPosition(pos);
//
//        return battleSoldierAObject;
//    }


    @Override
    public String getSpriteObjectIndex()
    {
        return spriteController.getObjectIndex();
    }


    @Override
    public SGCommonProto.PlayerBaseInfo parseBaseInfo(String... names)
    {
        SGCommonProto.PlayerBaseInfo.Builder baseInfo = SGCommonProto.PlayerBaseInfo.newBuilder();
        baseInfo.setNickName((names.length==0|| CoreUtils.isNullOrEmpty(names[0])) ? spriteController.getName() : names[0]);

        Player player = ((PlayerController) spriteController).getPlayer();
        baseInfo.setAvatar(player.avatar);
        baseInfo.setFc(player.fc);
        baseInfo.setLv(player.getLv());
        baseInfo.setVipLv(player.getVipLevel());
        baseInfo.setCamptypeValue(player.camp);

        return baseInfo.build();
    }

}
